This invention relates to a method of enhancing text which is rendered as a bi-tonal bit-mapped image for subsequent printing on a printer.
It is common practice for a printer to be connected to and controlled by a computer system, so that digital information handled by the computer system can be printed out. An example of this type of set up is shown in FIG. 1.
Typically, the computer system 207 will have an operating system (OS), such as a version of the Microsoft (MS) Windows operating system, available from the Microsoft Corporation, USA. With this operating system installed, the computer system can run various application processes such as a word processing package or a spreadsheet package. When an application 201 desires to print information on the printer 205, the application process makes an initial call to a graphical device interface (GDI) 202 and, after receiving confirmation that the call was successful, proceeds to send print data to the GDI. The GDI is a part of the MS Windows OS and provides a general interface between applications 201 running under the OS and graphical devices supported by the OS, e.g. displays 206 and printers 205.
After receiving a call from an application 201 to initiate printing, the GDI 202 interprets the print data received from the application and sends related print data to a printer driver 203. The related print data is device-independent and will, in most cases, closely match the print data received from the application 201. The printer driver 203 translates the device-independent print data from the GDI into signals which the printer 205 can use to print the original information from the application. These printer driver signals are usually dependent on and specific to the printer type or model. Accordingly, the printer driver is usually a proprietary piece of software separate from the OS that is provided by the manufacturer of the printer 205.
In general, there are two distinct types of device independent print data which are sent to the printer driver 203. These are often termed scalable and non-scalable print data. Scalable print data includes vector graphic data, such as scalable primitives defining ellipses and squares, and scalable fonts, such as Postscript(trademark). This scalable print data is sent as graphical or text commands or instructions to the printer driver.
Non-scalable print data includes raster graphic data, which is generally in the form of a bitmap or bitmapped image. This non-scalable print data is sent as bitmap data to the printer driver. Normally, the non-scalable bitmaps contain renderings of photographic images or graphics, but on occasions these non-scalable bitmaps contain renderings of text. The term xe2x80x9ctextxe2x80x9d in this context includes individual symbols, signs, glyphs, icons, characters, or combinations and multiples thereof.
A photographic image often contains shades and is therefore typically rendered as grey-scale or multi-tonal bitmapped image in the print data. The bitmapped image is said to have depth due to the picture elements (pixels) having values other than zero or one. In contrast, text is generally displayed as black on white or one colour on another colour. Text is therefore typically rendered as a 1 bit or bi-tonal bit-mapped image in the print data.
From the foregoing it can be appreciated that text may be sent to a printer driver either as a scalable font or as a bi-tonal bitmapped image. Scalable fonts are commonly used when, for example, a document is created in a word processing application and is printed directly from that application to a local or networked printer. In contrast, bi-tonal bitmapped images are commonly used when, for example, a document utilising embedded fonts is imported to an application for printing directly from that application.
Normally, the resolution of bitmapped images sent to the printer driver by the operating system is optimised (i.e. made equal) to the maximum resolution of the printer, e.g. both resolutions equal to 300 dots-per-inch (dpi). Scalable print data, such as scalable fonts, will therefore be printed at the same resolution as bitmapped images, such as bitmapped fonts. However, recent advances in the technology of printers developed by certain manufacturers has lead to higher printer resolutions becoming available, e.g. 600 dpi and 1200 dpi. Ordinarily, manufacturers of these printers provide associated printer drivers capable of (i) processing print data at the higher resolutions and (ii) sending signals at these higher resolutions to the printer so that higher quality print outs can be obtained, e.g. 600 dpi and 1200 dpi.
In an effort to optimise the resolution of bitmapped images sent to these high resolution printer drivers, the application or operating system could render the original images at the higher resolution. However, this high resolution rendering would require the application or operating system to be modified, which may not be commercially acceptable to a user. Furthermore, whereas a manufacturer can make a proprietary high resolution printer driver compatible with a printer with relative ease, the application processes and the operating system are generally not proprietary, and any resulting incompatibility may lead to significant increases in complexity and computational demands in the computer system. This consequence is undesirable.
Accordingly, it is known for high resolution printer drivers to report a relatively lower resolution (e.g. 300 dpi) to the operating system. Thus, the resolution capability of the system is compromised in favour of a more compatible and simpler solution. A consequence of this is that scalable print data, such as scalable fonts, are printed at the higher resolution (e.g. 600 dpi) whilst bitmapped images, such as bitmapped fonts, are printed at the lower resolution (e.g. 300 dpi). This consequence too is undesirable.
The two prior art solutions for dealing with higher resolutions printers both have their respective drawbacks. A user is thus faced with a dilemma of which solution to implement in his computer system. In this case neither prior art solution is totally satisfactory.
The present invention provides a enhancement technique which works by enhancing data that is depicted in 1-bit bitmaps. The technique in accordance with the invention may be applied to enhance line art data. However, enhancement is particularly noticeable when the technique is applied to text data. Uses for this technique include cases where a printer driver is invoked to handle bitmaps passed to it by a computer""s operating system. In particular, the technique is especially useful in cases where the bitmaps being passed to the printer driver are sub-optimal and can be enhanced prior to sending to a printer. Such cases include situations where bitmaps are formatted at one resolution (e.g. 300 dpi), but the printer driver internally renders them at a higher resolution (e.g. 600 dpi). Also, if the printer device is capable of handling a higher resolution than that used by the operating system, the invention may be applied to scale smoothly from a lower dpi to a higher dpi, leading to text or line art graphics that appears as if it were rendered at a higher dpi and not the original lower dpi it was received at.
The method according to the invention involves expanding each source pixel of a bitmap into a plurality of pixels and varying the pixel intensities (0s or 1s) of the expanded pixels. In particular, the pixel intensities are varied according to results of a gradient convolution operation performed on the original bitmap. Ideally, the varying step also takes into account the values of the source pixels of the bitmap. This process may involve varying each expanded pixel intensity in dependence solely on the associated source pixel, or in dependence additionally on neighbouring source pixels.
Suitably, the method according to the invention includes the step of receiving a source bit-mapped image at a low resolution for printing on a printer at a higher resolution. The higher resolution is preferably a multiple of the lower resolution. Ideally, the higher resolution is an even multiple of the lower resolution, for example, twice the lower resolution.
A method in accordance with the invention has the advantage that it allows an application or operating system to supply source bit-mapped images to a printer driver at a low resolution but still benefit from the higher resolution of a printer to which the images are being sent. This enables the application or operating system to operate at the low resolution in an efficient manner without modification. At the same time the signals output to the printer may be optimised to the resolution of the printer. Consequently, simplicity is maintained in the computer system whilst providing enhanced text or line art graphics in print outs.
The extent and scope of the present invention is defined in the appended Claims to which reference should now be made.
The technique enhances data, in particular text and line art, depicted in the 1-bit source image by considering each source pixel in turn and varying the pixel-intensities in the resulting 2xc3x972 pixel expansion for each source pixel. This approach allows the text or line art to be smoothed out in the process of scaling/expansion.
Bisonal (1-bit deep) bitmaps are scaled by a factor of 2 using this technique. When these bitmaps depict text, this technique has the effect of smoothly scaling the text as well, leading to improved print quality.
The basis of smoothing the edges of the text or line art depicted in source bitmaps is the stepwise application of both the horizontal and vertical Sobel operators over the source image to produce intensity gradients which are used to determine if the 2xc3x972-pixel expansion of a given source pixel needs to have its diagonally-opposite corner pixels modified. Selected corner pixels take on the intensity of their original surrounding pixels if those surrounding source pixels are found to be uniform; otherwise they are set to the original colour of the source pixel being considered.